#include "TTSParams.h"

#include <arpa/inet.h>

void TTSParams::hton()
{
    Id = htonl(Id);
    Command = htonl(Command);
    Len = htonl(Len);

    Version = htons(Version);
    CodePage = htons(CodePage);
    Domain = htons(Domain);
    Pitch = htons(Pitch);
    Volume = htons(Volume);
    Speed = htons(Speed);
    PuncMode = htons(PuncMode);
    DigitMode = htons(DigitMode);
    EngMode = htons(EngMode);
    TagMode = htons(TagMode);
    IdleTime = htons(IdleTime);
    LoadBalance = htonl(LoadBalance);
    VoiceStyle = htons(VoiceStyle);
    BackAudio = htons(BackAudio);
    BackAudioVolume = htons(BackAudioVolume);
    BackAudioFlag = htons(BackAudioFlag);

    uint16 t = VoiceBufSize;
    VoiceBufSize = (t & 0x00FF) | ((t >> 8) | 0x00FF);
    t = InsertInfoSize;
    InsertInfoSize = (t & 0x00FF) | ((t >> 8) | 0x00FF);

    Format = htons(Format);
}
